package com.tensquare.user;
/*
 *ClassName:UserApplication
 *Description:用户微服务：管理员，普通用户9008
 *@author:可爱的大鸭子
 */

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import util.IdWorker;
import util.JwtUtil;

@SpringBootApplication
@EnableEurekaClient
public class UserApplication {
    public static void main(String[] args) {
        SpringApplication.run(UserApplication.class,args);
    }

    @Bean
    public IdWorker idWorkker(){
        return new IdWorker(1, 1);
    }

    /*向IOC容器注册密码加密类*/
    @Bean
    public BCryptPasswordEncoder bcryptPasswordEncoder(){
        return new BCryptPasswordEncoder();
    }
    /*向容器注册后台签发token的类*/
    @Bean
    public JwtUtil jwtUtil(){
        return new util.JwtUtil();
    }
}
